home *** CD-ROM | disk | FTP | other *** search
/ Kit PC World De Ampliacion De Windows 95 / Kit PC World de ampliacion de Windows 95.iso / internet / sweeper / samples / olecon~1 / controls / invisi~1 / invisi~1.h < prev    next >
Text File  |  1995-11-25  |  4KB  |  115 lines

  1. //=--------------------------------------------------------------------------=
  2. // InvisibleCtl.H
  3. //=--------------------------------------------------------------------------=
  4. // Copyright  1995  Microsoft Corporation.  All Rights Reserved.
  5. //
  6. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF 
  7. // ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO 
  8. // THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A 
  9. // PARTICULAR PURPOSE.
  10. //=--------------------------------------------------------------------------=
  11. //
  12. // class declaration for the Invisible control.
  13. //
  14. #ifndef _INVISIBLECONTROL_H_
  15.  
  16. #include "IPServer.H"
  17. #include "CtrlObj.H"
  18. #include "InvisibleInterfaces.H"
  19. #include "Dispids.H"
  20.  
  21. typedef struct tagINVISIBLECTLSTATE {
  22.  
  23.     long    lTimeOut;
  24.  
  25. } INVISIBLECTLSTATE;
  26.  
  27. //=--------------------------------------------------------------------------=
  28. // CInvisibleControl
  29. //=--------------------------------------------------------------------------=
  30. // our control.
  31. //
  32. class CInvisibleControl : public COleControl, public IInvisible, public ISupportErrorInfo {
  33.  
  34.   public:
  35.     // IUnknown methods
  36.     //
  37.     DECLARE_STANDARD_UNKNOWN();
  38.  
  39.     // IDispatch methods
  40.     //
  41.     DECLARE_STANDARD_DISPATCH();
  42.  
  43.     // ISupportErrorInfo methods
  44.     //
  45.     DECLARE_STANDARD_SUPPORTERRORINFO();
  46.  
  47.     // IInvisible methods
  48.     //
  49.     // TODO: copy over the method declarations from InvisibleInterfaces.H
  50.     //       don't forget to remove the PURE from them.
  51.     //
  52.     STDMETHOD(get_TimeOut)(long FAR* plTimeOut);
  53.     STDMETHOD(put_TimeOut)(long lTimeOut);
  54.     STDMETHOD_(void, AboutBox)(void);
  55.  
  56.     // OLE Control stuff follows:
  57.     //
  58.     CInvisibleControl(IUnknown *pUnkOuter);
  59.     virtual ~CInvisibleControl();
  60.  
  61.     // static creation function.  all controls must have one of these!
  62.     //
  63.     static IUnknown *Create(IUnknown *);
  64.  
  65.   private:
  66.     // overridables that the control must implement.
  67.     //
  68.     STDMETHOD(LoadBinaryState)(IStream *pStream);
  69.     STDMETHOD(SaveBinaryState)(IStream *pStream);
  70.     STDMETHOD(LoadTextState)(IPropertyBag *pPropertyBag, IErrorLog *pErrorLog);
  71.     STDMETHOD(SaveTextState)(IPropertyBag *pPropertyBag, BOOL fWriteDefault);
  72.     STDMETHOD(OnDraw)(HDC hdcDraw, LPCRECTL prcBounds, LPCRECTL prcWBounds, HDC hicTargetDev);
  73.     virtual LRESULT WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  74.     virtual BOOL    RegisterClassData(void);
  75.  
  76.     STDMETHODIMP    FreezeEvents(BOOL);
  77.     virtual BOOL    OnSetExtent(SIZEL *pSize);
  78.     virtual HRESULT InternalQueryInterface(REFIID, void **);
  79.  
  80.     // private state information.
  81.     //
  82.     INVISIBLECTLSTATE m_state;
  83.     HICON m_hIcon;
  84.     BOOL  m_fTimer;
  85. };
  86.  
  87.  
  88. // TODO: if you have an array of verbs, then add an extern here with the name
  89. //       of it, so that you can include it in the DEFINE_CONTROLOBJECT.
  90. //       ie.  extern VERBINFO m_InvisibleCustomVerbs [];
  91. //
  92. extern const GUID    *rgInvisiblePropPages [];
  93. DEFINE_CONTROLOBJECT(Invisible,
  94.     &CLSID_Invisible,
  95.     "InvisibleCtl",
  96.     CInvisibleControl::Create,
  97.     1,
  98.     &IID_IInvisible,
  99.     "Invisible.HLP",
  100.     &DIID_DInvisibleEvents,
  101.     OLEMISC_INVISIBLEATRUNTIME|OLEMISC_SETCLIENTSITEFIRST|OLEMISC_ACTIVATEWHENVISIBLE|OLEMISC_RECOMPOSEONRESIZE|OLEMISC_CANTLINKINSIDE|OLEMISC_INSIDEOUT,
  102.     RESID_TOOLBOX_BITMAP,
  103.     "InvisibleWndClass",
  104.     1,
  105.     rgInvisiblePropPages,
  106.     0,
  107.     NULL);
  108.  
  109.  
  110.  
  111. #define _INVISIBLECONTROL_H_
  112. #endif // _INVISIBLECONTROL_H_
  113.  
  114.  
  115.